# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..10"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
$OSTREE checkout test2 checkout-test2
echo "ok checkout"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..48"
export TEST_GPG_KEYHOME=${test_tmpdir}/gpghome
export OSTREE_GPG_HOME=${test_tmpdir}/gpghome/trusted
-if test -n "${OT_TESTS_DEBUG}"; then
+if test -n "${OT_TESTS_DEBUG:-}"; then
set -x
fi
-if test -n "$OT_TESTS_VALGRIND"; then
+if test -n "${OT_TESTS_VALGRIND:-}"; then
CMD_PREFIX="env G_SLICE=always-malloc valgrind -q --leak-check=full --num-callers=30 --suppressions=${SRCDIR}/ostree-valgrind.supp"
else
CMD_PREFIX="env LD_PRELOAD=${SRCDIR}/libreaddir-rand.so"
setup_fake_remote_repo1() {
mode=$1
- commit_opts=$2
- args=$3
+ commit_opts=${2:-}
+ args=${3:-}
shift
oldpwd=`pwd`
mkdir ostree-srv
mkdir ${test_tmpdir}/httpd
cd httpd
ln -s ${test_tmpdir} ostree
- ${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/httpd-port $args
+ ${CMD_PREFIX} ostree trivial-httpd --autoexit --daemonize -p ${test_tmpdir}/httpd-port
port=$(cat ${test_tmpdir}/httpd-port)
echo "http://127.0.0.1:${port}" > ${test_tmpdir}/httpd-address
cd ${oldpwd}
os_repository_new_commit ()
{
- boot_checksum_iteration=$1
- content_iteration=$2
+ boot_checksum_iteration=${1:-0}
+ content_iteration=${2:-0}
echo "BOOT ITERATION: $boot_checksum_iteration"
- if test -z "$boot_checksum_iteration"; then
- boot_checksum_iteration=0
- fi
- if test -z "$content_iteration"; then
- content_iteration=0
- fi
cd ${test_tmpdir}/osdata
rm boot/*
echo "new: a kernel ${boot_checksum_iteration}" > boot/vmlinuz-3.6.0
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
function repo_init() {
cd ${test_tmpdir}
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
bootcsum3=${bootcsum}
${CMD_PREFIX} ostree admin upgrade --os=testos
-rev=${newrev}
newrev=$(${CMD_PREFIX} ostree --repo=sysroot/ostree/repo rev-parse testos/buildmaster/x86_64-runtime)
assert_not_streq ${rev} ${newrev}
assert_not_streq ${bootcsum1} ${bootcsum2}
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# See https://github.com/GNOME/ostree/pull/145
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
-if ! ${CMD_PREFIX} ostree --version | grep -q -e '\+gpgme'; then
+if ! ostree --version | grep -q -e '\+gpgme'; then
exit 77
fi
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..2"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
-if ! ${CMD_PREFIX} ostree --version | grep -q -e '\+gpgme'; then
+if ! ostree --version | grep -q -e '\+gpgme'; then
exit 77
fi
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
if [ $? = 0 ] ; then
echo 1>&2 "missing subcommand but 0 exit status"; exit 1
fi
- set -e
+ set -euo pipefail
# error message and usage goes to standard error
assert_file_has_content err "[Uu]sage"
assert_file_has_content err "$cmd"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
-if ! ${CMD_PREFIX} ostree --version | grep -q -e '\+libarchive'; then
+if ! ostree --version | grep -q -e '\+libarchive'; then
exit 77
fi
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
gjs $(dirname $0)/corrupt-repo-ref.js ${repopath} main || true
assert_file_has_content corrupted-status.txt 'Changed byte'
do_corrupt_pull_test
-echo "ok corruption $iteration"
+echo "ok corruption"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
. $(dirname $0)/libtest.sh
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
echo "1..1"
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.
-set -e
+set -euo pipefail
touch test-xattrs
if ! setfattr -n user.testvalue -v somevalue test-xattrs; then